package com.scy.java.object;

public class Person {
    String name;
    private int age;
    char sex;

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if (age>=0 && age<=130){
            this.age = age;
        }else {
            System.out.println("数据不合法");
        }
    }

    public void study(){
        System.out.println("studying");
    }
    public int showAge(){
        return age;

    }
    public void addAge(int addAge){
        age += addAge;
        System.out.println(age);


    }
}
